
package ogame.utilities.planets;

import ogame.utilities.Coords;
import ogame.utilities.Player;
import ogame.utilities.Resources;
import ogame.utilities.ships.Ships;
import ogame.utilities.buildings.Buildings;
import ogame.utilities.datastorage.OgameDataStorage;
import ogame.utilities.datastorage.subtables.PlanetTable;
import ogame.utilities.defenses.Defenses;

/**
 *
 * @author scchang
 */
public class Planet {
    protected String name;
    protected Player player;
    protected Defenses defenses;
    protected Ships ships;
    protected Coords coords;
    protected Resources resources;
    protected Buildings buildings;
    
    public Planet(Player player, String name, Coords coords){
        this(player, new Defenses(), new Ships(), new Resources(),
                new Buildings(), name, coords);
    }
    
    public Planet(Player player, Defenses defenses, Ships ships, Resources resources, 
            Buildings buildings, String name, Coords coords){
        this.player = player;
        this.defenses = defenses;
        this.ships = ships;
        this.coords = coords;
        this.resources = resources;
        this.name = name;
        this.buildings = buildings;
    }
    
    /**
     * @return the defense
     */
    public Defenses getDefenses() {
        return defenses;
    }

    /**
     * @param defense the defense to set
     */
    public void setDefenses(Defenses defense) {
        this.defenses = defense;
    }

    /**
     * @return the ships
     */
    public Ships getShips() {
        return ships;
    }

    /**
     * @param ships the ships to set
     */
    public void setShips(Ships ships) {
        this.ships = ships;
    }

    /**
     * @return the player
     */
    public Player getPlayer() {
        return player;
    }

    /**
     * @param player the player to set
     */
    public void setPlayer(Player player) {
        this.player = player;
    }

    /**
     * @return the coords
     */
    public Coords getCoords() {
        return coords;
    }

    /**
     * @param coords the coords to set
     */
    public void setCoords(Coords coords) {
        this.coords = coords;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the resources
     */
    public Resources getResources() {
        return resources;
    }

    /**
     * @param resources the resources to set
     */
    public void setResources(Resources resources) {
        this.resources = resources;
    }
    
    public String toString(){
        String output = "Planet : " + this.getName();
        output += " : " + this.coords.toString();
        output += " : " + this.getPlayer().getName() + '\n';
        output += "/////////////////////////////////////////////////////////\n";
        output += "Buildings\n" + this.getBuildings().toString();
        output += "/////////////////////////////////////////////////////////\n";
        output += "Ships\n" + this.ships.toString();
        output += "/////////////////////////////////////////////////////////\n";
        output += "Defenses\n" + this.defenses.toString();
        return output;
    }

    /**
     * @return the buildings
     */
    public Buildings getBuildings() {
        return buildings;
    }

    /**
     * @param buildings the buildings to set
     */
    public void setBuildings(Buildings buildings) {
        this.buildings = buildings;
    }
}
